
(function(ns){

var Zhongzi = ns.Zhongzi = Hilo.Class.create({
    Extends: Hilo.Sprite,
    constructor: function(properties){
		//console.log(properties)
        Zhongzi.superclass.constructor.call(this, properties);
        
        this.addFrame(properties.atlas.getSprite('zhongzi'));
        this.interval = 6;
		this.loop = false;
        this.pivotX = .5;
        this.pivotY = .5;
		// this.scaleX = .5;
		// this.scaleY = .5;
    },
	isReady:false,
	doNum:0,
    getReady: function(){
		if(!utilsClass.isEmpty(window.game.InitData)){
			if(window.game.InitData.watermelon.status==0)
			this.isReady = true
			this.play();
		}else{
			this.stop();
		}
		
        //this.isReady = true
    },
    onUpdate: function(){
		//console.log(this.doNum)
		if(this.isReady){
			this.doNum++;
			if(this.currentFrame==16){
				if(this.doNum/200==1){
					this.goto(9,true)
					this.play()
					this.doNum = 0
				}
				
			}
		}
    }
});

})(window.game);